<?php
// 保存到数据库
date_default_timezone_set("PRC");

$dsn = "mysql:host=127.0.0.1;dbname=blog";
$db = new PDO($dsn, "root", "123456");
$db->exec("set names utf8mb4");

$addTime = time();
$updateTime = $addTime;

$sql = "insert into article (article_title, category_id, intro, content, add_time, update_time) 
  values ('$articleTitle', '$categoryId', '$intro', '$content', '$addTime', '$updateTime')";
$result = $db->exec($sql);
//var_dump($db->errorInfo());